package solver;

import ilog.concert.IloException;
import problem.SingleWareHouseProblem;
import uncertainty.UncertaintySet;
import util.Memorier;
import util.Timer;

public abstract class Solver {
	
	protected Memorier mem;
	protected Timer timer;
	protected SingleWareHouseProblem prob;
	protected UncertaintySet us;
	protected int numrest;
	protected int numvar;
	
	public Solver(SingleWareHouseProblem p, UncertaintySet s) {
		mem = new Memorier();
		timer = new Timer();
		numvar = 0;
		numrest = 0;
	}
	
	public abstract boolean build() throws IloException;
	
	public abstract double solve() throws IloException;

	public double memoryUsedB(){
		double m = mem.getUsedMemB();
		return m;
	}
	
	public double memoryUsedKB(){
		double m = mem.getUsedMemKB();
		return m;
	}
	
	public double memoryUsedMB(){
		double m = mem.getUsedMemMB();
		return m;
	}
	
	public double timeUsedMiliSec(){
		return timer.getTimeMiliSec();
	}
	
	public double timeUsedSec(){
		return timer.getTimeSec();
	}
	
	public int getRestNumber(){
		return numrest;
	}
	
	public int getVarNumber(){
		return numvar;
	}
}
